3.22 \(\int (a+a \sec (c+d x))^2 \tan ^3(c+d x) \, dx\)

Optimal. Leaf size=65 \[ \frac{a^2 \sec ^4(c+d x)}{4 d}+\frac{2 a^2 \sec ^3(c+d x)}{3 d}-\frac{2 a^2 \sec (c+d x)}{d}+\frac{a^2 \log (\cos (c+d x))}{d} \]

[Out]

(a^2*Log[Cos[c + d*x]])/d - (2*a^2*Sec[c + d*x])/d + (2*a^2*Sec[c + d*x]^3)/(3*d) + (a^2*Sec[c + d*x]^4)/(4*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0558754, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {3879, 75} \[ \frac{a^2 \sec ^4(c+d x)}{4 d}+\frac{2 a^2 \sec ^3(c+d x)}{3 d}-\frac{2 a^2 \sec (c+d x)}{d}+\frac{a^2 \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Sec[c + d*x])^2*Tan[c + d*x]^3,x]

[Out]

(a^2*Log[Cos[c + d*x]])/d - (2*a^2*Sec[c + d*x])/d + (2*a^2*Sec[c + d*x]^3)/(3*d) + (a^2*Sec[c + d*x]^4)/(4*d)

Rule 3879

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[1/(a^(m - n
- 1)*b^n*d), Subst[Int[((a - b*x)^((m - 1)/2)*(a + b*x)^((m - 1)/2 + n))/x^(m + n), x], x, Sin[c + d*x]], x] /
; FreeQ[{a, b, c, d}, x] && IntegerQ[(m - 1)/2] && EqQ[a^2 - b^2, 0] && IntegerQ[n]

Rule 75

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && EqQ[b*e + a*f, 0] &&  !(ILtQ[n
 + p + 2, 0] && GtQ[n + 2*p, 0])

Rubi steps

\begin{align*} \int (a+a \sec (c+d x))^2 \tan ^3(c+d x) \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{(a-a x) (a+a x)^3}{x^5} \, dx,x,\cos (c+d x)\right )}{a^2 d}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{a^4}{x^5}+\frac{2 a^4}{x^4}-\frac{2 a^4}{x^2}-\frac{a^4}{x}\right ) \, dx,x,\cos (c+d x)\right )}{a^2 d}\\ &=\frac{a^2 \log (\cos (c+d x))}{d}-\frac{2 a^2 \sec (c+d x)}{d}+\frac{2 a^2 \sec ^3(c+d x)}{3 d}+\frac{a^2 \sec ^4(c+d x)}{4 d}\\ \end{align*}

Mathematica [A]  time = 0.182215, size = 83, normalized size = 1.28 \[ \frac{a^2 \sec ^4(c+d x) (3 (-4 \cos (3 (c+d x))+4 \cos (2 (c+d x)) \log (\cos (c+d x))+\cos (4 (c+d x)) \log (\cos (c+d x))+3 \log (\cos (c+d x))+2)-20 \cos (c+d x))}{24 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sec[c + d*x])^2*Tan[c + d*x]^3,x]

[Out]

(a^2*(-20*Cos[c + d*x] + 3*(2 - 4*Cos[3*(c + d*x)] + 3*Log[Cos[c + d*x]] + 4*Cos[2*(c + d*x)]*Log[Cos[c + d*x]
] + Cos[4*(c + d*x)]*Log[Cos[c + d*x]]))*Sec[c + d*x]^4)/(24*d)

________________________________________________________________________________________

Maple [B]  time = 0.044, size = 140, normalized size = 2.2 \begin{align*}{\frac{{a}^{2} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{2\,d}}+{\frac{{a}^{2}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+{\frac{2\,{a}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{3\,d \left ( \cos \left ( dx+c \right ) \right ) ^{3}}}-{\frac{2\,{a}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{3\,d\cos \left ( dx+c \right ) }}-{\frac{2\,{a}^{2}\cos \left ( dx+c \right ) \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{3\,d}}-{\frac{4\,{a}^{2}\cos \left ( dx+c \right ) }{3\,d}}+{\frac{{a}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{4\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sec(d*x+c))^2*tan(d*x+c)^3,x)

[Out]

1/2/d*a^2*tan(d*x+c)^2+a^2*ln(cos(d*x+c))/d+2/3/d*a^2*sin(d*x+c)^4/cos(d*x+c)^3-2/3/d*a^2*sin(d*x+c)^4/cos(d*x
+c)-2/3/d*a^2*cos(d*x+c)*sin(d*x+c)^2-4/3/d*a^2*cos(d*x+c)+1/4/d*a^2*sin(d*x+c)^4/cos(d*x+c)^4

________________________________________________________________________________________

Maxima [A]  time = 1.14314, size = 78, normalized size = 1.2 \begin{align*} \frac{12 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) - \frac{24 \, a^{2} \cos \left (d x + c\right )^{3} - 8 \, a^{2} \cos \left (d x + c\right ) - 3 \, a^{2}}{\cos \left (d x + c\right )^{4}}}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2*tan(d*x+c)^3,x, algorithm="maxima")

[Out]

1/12*(12*a^2*log(cos(d*x + c)) - (24*a^2*cos(d*x + c)^3 - 8*a^2*cos(d*x + c) - 3*a^2)/cos(d*x + c)^4)/d

________________________________________________________________________________________

Fricas [A]  time = 1.18463, size = 163, normalized size = 2.51 \begin{align*} \frac{12 \, a^{2} \cos \left (d x + c\right )^{4} \log \left (-\cos \left (d x + c\right )\right ) - 24 \, a^{2} \cos \left (d x + c\right )^{3} + 8 \, a^{2} \cos \left (d x + c\right ) + 3 \, a^{2}}{12 \, d \cos \left (d x + c\right )^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2*tan(d*x+c)^3,x, algorithm="fricas")

[Out]

1/12*(12*a^2*cos(d*x + c)^4*log(-cos(d*x + c)) - 24*a^2*cos(d*x + c)^3 + 8*a^2*cos(d*x + c) + 3*a^2)/(d*cos(d*
x + c)^4)

________________________________________________________________________________________

Sympy [A]  time = 3.54419, size = 126, normalized size = 1.94 \begin{align*} \begin{cases} - \frac{a^{2} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{a^{2} \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{4 d} + \frac{2 a^{2} \tan ^{2}{\left (c + d x \right )} \sec{\left (c + d x \right )}}{3 d} + \frac{a^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} - \frac{a^{2} \sec ^{2}{\left (c + d x \right )}}{4 d} - \frac{4 a^{2} \sec{\left (c + d x \right )}}{3 d} & \text{for}\: d \neq 0 \\x \left (a \sec{\left (c \right )} + a\right )^{2} \tan ^{3}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))**2*tan(d*x+c)**3,x)

[Out]

Piecewise((-a**2*log(tan(c + d*x)**2 + 1)/(2*d) + a**2*tan(c + d*x)**2*sec(c + d*x)**2/(4*d) + 2*a**2*tan(c +
d*x)**2*sec(c + d*x)/(3*d) + a**2*tan(c + d*x)**2/(2*d) - a**2*sec(c + d*x)**2/(4*d) - 4*a**2*sec(c + d*x)/(3*
d), Ne(d, 0)), (x*(a*sec(c) + a)**2*tan(c)**3, True))

________________________________________________________________________________________

Giac [B]  time = 2.0711, size = 259, normalized size = 3.98 \begin{align*} -\frac{12 \, a^{2} \log \left ({\left | -\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 12 \, a^{2} \log \left ({\left | -\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac{57 \, a^{2} + \frac{252 \, a^{2}{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac{246 \, a^{2}{\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac{124 \, a^{2}{\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac{25 \, a^{2}{\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}}{{\left (\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{4}}}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2*tan(d*x+c)^3,x, algorithm="giac")

[Out]

-1/12*(12*a^2*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1)) - 12*a^2*log(abs(-(cos(d*x + c) - 1)/(cos(d
*x + c) + 1) - 1)) + (57*a^2 + 252*a^2*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 246*a^2*(cos(d*x + c) - 1)^2/(c
os(d*x + c) + 1)^2 + 124*a^2*(cos(d*x + c) - 1)^3/(cos(d*x + c) + 1)^3 + 25*a^2*(cos(d*x + c) - 1)^4/(cos(d*x
+ c) + 1)^4)/((cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1)^4)/d